package com.example.service.impl;

import com.example.dao.AddressBookDao;
import com.example.domain.AddressBook;
import com.example.service.AddressBookService;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AddressBookServiceImpl implements AddressBookService {
    @Autowired
    private AddressBookDao addressBookDao;
    @Override
    public List<AddressBook> selectall(int pageCount, int pageSize, Long userId) {
       return addressBookDao.selectall(pageCount,pageSize,userId);
    }

    @Override
    public int getcount(Long userId) {
        return addressBookDao.getcount(userId);
    }

    @Override
    public List<AddressBook> list(Long userId) {
        return addressBookDao.list(userId);
    }

    @Override
    public void setstatusall(Long userId) {
        addressBookDao.setstatusall(userId);
    }

    @Override
    public void setstatusone(AddressBook addressBook) {
        addressBookDao.setstatusone(addressBook);
    }

    @Override
    public void save(AddressBook addressBook) {
        addressBookDao.save(addressBook);
    }

    @Override
    public AddressBook alert(Long id) {
        return addressBookDao.alert(id);
    }

    @Override
    public void update(AddressBook addressBook) {
        addressBookDao.update(addressBook);
    }

    @Override
    public void delete(Long id) {
        addressBookDao.delete(id);
    }

    @Override
    public AddressBook getdefault(Long userId) {
        return addressBookDao.getdefault(userId);
    }

    @Override
    public AddressBook selectbydefault(Long userId) {
        return addressBookDao.selectbydefault(userId);
    }
}
